import { UserApi } from '../api.ts';
import http from '../http.ts';

/**
 * 登录
 */
export function login(params: any) {
    return http.post(
        UserApi.LOGIN, 
        params, 
        {
            loading: true
        }
    )
}

/**
 * 查询所有用户信息
 */
export function getAllUser(params:any) {
    return http.get(
        UserApi.GET_ALL_USER, 
        params, 
        {
            loading: true
        }
    )
}

/**
 * 新增用户
 */
export function addUser(params:any) {
    return http.post(
        UserApi.ADD_USER, 
        params, 
        {
            loading: true
        }
    )
}

/**
 * 修改用户
 */
export function updateUser(params:any) {
    return http.post(
        UserApi.UPDATE_USER, 
        params, 
        {
            loading: true
        }
    )
}